﻿@{
    Layout = "~/Views/_LayoutPage1.cshtml";
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.ksdm</title>
   
</head>
<body>
    <div class="loading-mask" id="isloading" style="display:none">
        <div class="loading-wrapper">
            <div class="loading-icon loading">
            </div><div class="loading-msg">加载中...</div>
        </div>
    </div>

    <input type="hidden" id="ksdm" value="@ViewBag.ksdm" />
    <input type="hidden" id="ksmc" value="@ViewBag.ksmc" />
    <div class="page" id="root">
        <div data-reactroot="">
      
            <div id="select_ys">
                <div>
                   
                        <div id="ptys"></div>
                        <div id="zjys"> </div>
               
                </div>
            </div>
          
        </div>
    </div>

    <script>

    $(function () {
        $.post("/Yygh/getDoctInfo", { "ksdm": $("#ksdm").val() }, function (result) {
            if (result.value == "1") {

                var ptys = "<p class='select-appointment-title'>普通预约</p>";

                ptys+="<ul class='list-ord'><li onclick='goyygh(-1)' class='list-item list-nowrap list-relative'><span class='background-icon' style='background-image: url(../../Content/img/doct.png); width: 58px; height: 58px; border-radius: 50%; display: block; margin-right: 12px;'></span><div class='list-content'><div class='list-title txt-nowrap' style='margin-right: 50px;'>普通</div></div><div class='select-doctor-flag'>可预约</div></li></ul>"

                $("#ptys").html(ptys);
            }

            if (result.data.length > 0) {
                var zyys = "<p class='select-appointment-title'>专家预约</p> <ul class='list-ord'>";
                for (var i = 0; i < result.data.length; i++) {
                    zyys += "<li onclick='goyygh(&quot;" + result.data[i].ysdm + "&quot;)' class='list-item list-nowrap list-relative'>"
                    zyys += "<span class='background-icon' style='background-image: url(../../Content/img/doct.png); width: 58px; height: 58px; border-radius: 50%; display: block; margin-right: 12px;'>"
                    zyys += "   </span><div class='list-content'>";
                    zyys += "   <div class='list-title txt-nowrap' style='margin-right: 50px;'>" + result.data[i].ysxm + "</div>  <div class='list-brief txt-nowrap'> 擅长:" + result.data[i].ysjs + "  </div></div>";

                    if (result.data[i].isky == "1") {
                        zyys += " <div class='select-doctor-flag'>可预约</div>";
                    } else {
                        zyys += " <div class='select-doctor-flag-offline'>已满</div>";
                    }

                }

                zyys += " </ul>";

                $("#zjys").html(zyys);

            }
            $(".loading-mask").hide();

            },"json")
           

        });
        $(".select-type-item span").mousedown(function () {

            if ($(this).text() == "按医生预约") {
                $("#select_rq").hide();
                $("#select_ys").show();
                $(this).addClass("select-type-active")
                $(".select-type-item span").not(this).removeClass("select-type-active")

            } else {
                $("#select_rq").show();
                $("#select_ys").hide();
                $(this).addClass("select-type-active")
                $(".select-type-item span").not(this).removeClass("select-type-active")
            }
        })

        $(".head td").mousedown(function () {

            $(this).addClass("select-date");
            $(".head td").not(this).removeClass("select-date");

        })


        function goyygh(ysdm) {
            $("#isloading").show();
            window.location.href = "/Yygh/Yspb?ksdm=" + $("#ksdm").val() + "&ysdm=" + ysdm + "&ksmc=" + $("#ksmc").val();
        }




    </script>
</body>
</html>
